import { defHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';

enum Api {
  getRuleList = '/api/attendance/rule/list',
  createRule = '/api/attendance/rule',
  deleteRule = '/api/attendance/rule',
  editRule = '/api/attendance/rule',
}
/**
 * @description: 部门考勤规则
 */
export const getRuleList = (params?: any) => {
  return defHttp.get<any>({ url: Api.getRuleList, params });
};
export const createRule = (params?: any) => {
  return defHttp.post<any>({ url: Api.createRule, params });
};
export const editRule = (params?: any) => {
  return defHttp.put<any>({ url: Api.editRule, params });
};
export const deleteRule = (params?: any) => {
  return defHttp.delete<any>(
    { url: Api.deleteRule, params, headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED } },
  );
};
